function getModuleList(){
	// Ajax Validate Module 
	/*-------------function begin---------------------------*/	
	$.ajax({
			type: "get",
	    	dataType:"xml",
			"url" : "AjaxGetModuleList",
			//提交的数�
			data: {},
			beforeSend: function(XMLHttpRequest){
            },
            success: function(data, textStatus){
            	 var moduleName ;
            	 var moduleType ;
            	  $("#chooseModule_container").html("");
                 $(data).find("moduleItem").each(function(index, element) {
                        moduleType    = $(this).children("moduleType").text();
                        moduleName    = $(this).children("moduleName").text();
                        $("#chooseModule_container").append(
                        "<div class='ListItem'><a onclick='showTree(\""+moduleType+"\",\""+moduleName+"\")' style='cursor:pointer;text-decoration:none;'>"+moduleName+"</a></div>"
                        );
                 });
		    },
			complete: function(XMLHttpRequest, textStatus){
				showContainer("chooseModuleContainer","chooseModule_close");
				
			},
			error: function(){
				
			}
	})
	/*-------------function end  ---------------------------*/
 }

 function showTree(moduleType,moduleName){
	hidenContainer("chooseModuleContainer");
	showContainer("addTreeContent","B_Close");
	loadJsTree(moduleType,moduleName);
 }
 function loadJsTree (moduleType,moduleName) {  
    $(function () {
    	$("#popTreeContent").jstree({ 
    		"plugins" : [ "themes", "json_data" ,"ui","crrm","dnd","search" ],
			 "themes":{
                   "theme" : "apple",
                   "dots"  : false,
                   "icons" : true
             },   
			"json_data" : { 
				 "ajax" : {  
					"url"  : "LoadModuleTreeServlet" ,
					"dataType": "json",
                    "contentType": "application/json charset=utf-8",
                    "data": function(n) { return { nodeId: n.attr ? n.attr("id") : "Module",moduleType : moduleType, moduleName : moduleName }; },
                    "success": function() {
                    }
           		  } 
			}
		}).bind("dblclick_node.jstree", 
		   function (event,data){
		       //:data.rslt.obj.attr("id") 
		       var oldName = document.getElementById("_name").value;
		       var deviationName = "";
		       var idStr = data.rslt.obj.attr("id").split("\\");
		       for(i = 1; i < idStr.length ; i++){
		       		deviationName += "/"+idStr[i];
		       }
		       hidenContainer("addTreeContent");
		       document.getElementById("_name").value =deviationName;
		       fromSubmit();
	    })
	 })
  }
  
  function ShowCreateDeviate(){
  	var currNodeId = document.getElementById("_name").value;
  	// Ajax Validate Module 
	/*-------------function begin---------------------------*/	
	$.ajax({
			type: "post",
	    	dataType:"xml",
			"url" : "AjaxGetDeviateInfoServlet",
			//提交的数�
			data: {currNodeId:currNodeId,nodeId:document.getElementById("nodeId").value},
			beforeSend: function(XMLHttpRequest){
            },
            success: function(data, textStatus){
            	 var  len = $(data).find("length").text();
            	 var  DeviateJsObj = new DeviateJs(len);
                 $(data).find("fieldItem").each(function(index, element) {
                        var fieldName     = $(this).text();
                        DeviateJsObj.add(fieldName);
                 });
                 DeviateJsObj.render();
		    },
			complete: function(XMLHttpRequest, textStatus){
				
				showContainer("addDeviateContent","createDeviate_close");
			},
			error: function(){
				
			}
	})
	/*-------------function end  ---------------------------*/
  }
  function HideCreateDeviate(){
  	hidenContainer("addDeviateContent");
  }
  /*****************************************************************************************/
  var myTabContainer = new TabContent();
  var mainTab = new Tab("mainContent",null);
  myTabContainer.add(mainTab);
  function CreateDeviate(){
  	var Deviate_Type = document.getElementById("Deviate_Type").value;
  	var url = "GoToFindDeviateServlet?parent_nodeId="+document.getElementById("nodeId").value+"&deviateType="+Deviate_Type;
  	var deviateTab = new Tab("Deviate",url);
  	myTabContainer.add(deviateTab);
  	
  }
  
  function CreateType(url){
  	var deviateTab = new Tab("Type",url);
  	myTabContainer.add(deviateTab);
  }
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  